-
Notifications
You must be signed in to change notification settings - Fork 4
Small fixes to CSV df and Configuration token #599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a sanity check for DataFrame indexes in the CSV parser and ensures the token field is preserved when loading configurations from file.
- Enforce that CSVParser only accepts pandas DataFrames with a RangeIndex.
- Pass the
tokenvalue into the Configuration constructor when reading from the CLI config file. - Improve error handling around Dask input for CSVParser.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| aperturedb/cli/configure.py | Include token argument when constructing Configuration from config. |
| aperturedb/CSVParser.py | Validate DataFrame index is a RangeIndex; raise exceptions for invalid CSV/Dask inputs. |
Comments suppressed due to low confidence (2)
aperturedb/CSVParser.py:69
- Add unit tests to verify that providing a non-RangeIndex DataFrame raises the expected exception in CSVParser.
if not isinstance(self.df.index, pd.RangeIndex):
aperturedb/cli/configure.py:79
- Add tests for loading and saving configurations to confirm the
tokenis correctly carried through and defaults toNonewhen absent.
token=config["token"] if "token" in config else None)
Co-authored-by: bovlb <[email protected]> Co-authored-by: Copilot <[email protected]>
CSVLoader actually wants an RangeIndex, since everything wants to use
startand only RangeIndex has it. It's better to catch it earlier.I missed passing token to Configuration when loading from the config file, so if you save a aperturedb key, it will lose the token when it loads.( This was included elsewhere in-between )